<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>test.jl</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Julia) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#7a7c7d;"># Test file for Julia</span>

<span style="color:#7a7c7d;"># Comment</span>

<span style="color:#7a7c7d;">#= Multi-line</span>
<span style="color:#7a7c7d;">   comment =#</span>

<span style="color:#2980b9;background-color:#153042;">#BEGIN</span>

<span style="color:#2980b9;background-color:#153042;">#END</span>

<span style="color:#f44f4f;">&quot;&quot;&quot;</span>
<span style="color:#f44f4f;"> Multi-line string</span>
<span style="color:#f44f4f;">&quot;&quot;&quot;</span>
<span style="color:#da4453;">```</span>
<span style="color:#da4453;"> Multi-line command</span>
<span style="color:#da4453;">```</span>
<span style="color:#f44f4f;">raw&quot;string\a\\a&quot;</span>

<span style="font-weight:bold;">let</span> z = zip(<span style="color:#f67400;">1</span>:<span style="color:#f67400;">2</span>, <span style="color:#f67400;">3</span>:<span style="color:#f67400;">4</span>, <span style="color:#f67400;">5</span>:<span style="color:#f67400;">6</span>)
    <span style="color:#27ae60;">@test</span> size(z) == (<span style="color:#f67400;">2</span>,)
    <span style="color:#27ae60;">@test</span> collect(z) == [(<span style="color:#f67400;">1</span>,<span style="color:#f67400;">3</span>,<span style="color:#f67400;">5</span>), (<span style="color:#f67400;">2</span>,<span style="color:#f67400;">4</span>,<span style="color:#f67400;">6</span>)]
    <span style="color:#27ae60;">@test</span> eltype(z) == <span style="color:#2980b9;">Tuple</span>{<span style="color:#2980b9;">Int</span>,<span style="color:#2980b9;">Int</span>,<span style="color:#2980b9;">Int</span>}
<span style="font-weight:bold;">end</span>

<span style="color:#27ae60;">@testset</span> <span style="color:#f44f4f;">&quot;generic conversion from Integer&quot;</span> <span style="font-weight:bold;">begin</span>
    x = rand(<span style="color:#2980b9;">Int128</span>)
    <span style="color:#27ae60;">@test</span> <span style="color:#2980b9;">BigInt</span>(x) % <span style="color:#2980b9;">Int128</span> === x
    y = rand(<span style="color:#2980b9;">UInt128</span>)
    <span style="color:#27ae60;">@test</span> <span style="color:#2980b9;">BigInt</span>(y) % <span style="color:#2980b9;">UInt128</span> === y
<span style="font-weight:bold;">end</span>

<span style="color:#27ae60;">@testset</span> <span style="color:#f44f4f;">&quot;show&quot;</span> <span style="font-weight:bold;">begin</span>
    <span style="color:#27ae60;">@test</span> sprint(show, <span style="color:#2980b9;">BitSet</span>()) == <span style="color:#f44f4f;">&quot;BitSet([])&quot;</span>
    <span style="color:#27ae60;">@test</span> sprint(show, <span style="color:#2980b9;">BitSet</span>([<span style="color:#f67400;">1</span>,<span style="color:#f67400;">2</span>,<span style="color:#f67400;">3</span>])) == <span style="color:#f44f4f;">&quot;BitSet([1, 2, 3])&quot;</span>
    show(<span style="color:#2980b9;">IOBuffer</span>(), <span style="color:#2980b9;">BitSet</span>())
<span style="font-weight:bold;">end</span>

cmd = <span style="color:#da4453;">`$(Base.julia_cmd()) --depwarn=error --startup-file=no boundscheck_exec.jl`</span>
<span style="font-weight:bold;">if</span> !success(pipeline(cmd; <span style="color:#27aeae;font-weight:bold;">stdout</span>=<span style="color:#27aeae;font-weight:bold;">stdout</span>, <span style="color:#27aeae;font-weight:bold;">stderr</span>=<span style="color:#27aeae;font-weight:bold;">stderr</span>))
    error(<span style="color:#f44f4f;">&quot;boundscheck test failed, cmd : $cmd&quot;</span>)
<span style="font-weight:bold;">end</span>

<span style="color:#27ae60;">@test</span> iterate(I, <span style="color:#2980b9;">CartesianIndex</span>(<span style="color:#f67400;">3</span>, typemax(<span style="color:#2980b9;">Int</span>)))[<span style="color:#f67400;">1</span>] == <span style="color:#2980b9;">CartesianIndex</span>(<span style="color:#f67400;">4</span>,typemax(<span style="color:#2980b9;">Int</span>))
<span style="color:#27ae60;">@test</span> iterate(I, <span style="color:#2980b9;">CartesianIndex</span>(<span style="color:#f67400;">4</span>, typemax(<span style="color:#2980b9;">Int</span>)))    === <span style="color:#27aeae;font-weight:bold;">nothing</span>
<span style="color:#27ae60;">@test_throws</span> <span style="color:#2980b9;">MethodError</span> <span style="color:#27aeae;font-weight:bold;">write</span>(<span style="color:#2980b9;">IOBuffer</span>(), ASCIIChar(<span style="color:#3daee9;">'x'</span>))
<span style="color:#27ae60;">@test_throws</span> <span style="color:#2980b9;">MethodError</span> <span style="color:#27aeae;font-weight:bold;">read</span>(<span style="color:#2980b9;">IOBuffer</span>(<span style="color:#3daee9;">'x'</span>), ASCIIChar)

<span style="font-weight:bold;">let</span> header = <span style="color:#f44f4f;">&quot;julia [switches] -- [programfile] [args...]&quot;</span>
    <span style="color:#27ae60;">@test</span> startswith(<span style="color:#27aeae;font-weight:bold;">read</span>(<span style="color:#da4453;">`$exename -h`</span>, <span style="color:#2980b9;">String</span>), header)
    <span style="color:#27ae60;">@test</span> startswith(<span style="color:#27aeae;font-weight:bold;">read</span>(<span style="color:#da4453;">`$exename --help`</span>, <span style="color:#2980b9;">String</span>), header)
<span style="font-weight:bold;">end</span>

<span style="color:#27ae60;">@test</span> isequal(exp(complex( <span style="color:#27aeae;font-weight:bold;">Inf</span>, <span style="color:#27aeae;font-weight:bold;">NaN</span>)), complex(-<span style="color:#27aeae;font-weight:bold;">Inf</span>, <span style="color:#27aeae;font-weight:bold;">NaN</span>))
<span style="color:#27ae60;">@test</span> isequal(exp(complex( <span style="color:#27aeae;font-weight:bold;">Inf</span>, <span style="color:#27aeae;font-weight:bold;">Inf</span>)), complex(-<span style="color:#27aeae;font-weight:bold;">Inf</span>, <span style="color:#27aeae;font-weight:bold;">NaN</span>))

<span style="color:#7a7c7d;"># Numbers</span>
<span style="color:#f67400;">0b10</span>
<span style="color:#f67400;">0o01_70</span>
<span style="color:#f67400;">0x00000000000000001111__22_2233334444</span>
-<span style="color:#f67400;">0x0002im</span>
<span style="color:#f67400;">1.0e10</span>
<span style="color:#f67400;">0.00025f0</span>
-<span style="color:#f67400;">1.5__5f0</span>
<span style="color:#f67400;">0xdeadbeefim</span>
<span style="color:#f67400;">0x1.8p3</span>
<span style="color:#f67400;">0x.4p-1</span>

chars = [<span style="color:#3daee9;">'0'</span>, <span style="color:#3daee9;">'1'</span>, <span style="color:#3daee9;">'2'</span>, <span style="color:#3daee9;">'3'</span>, <span style="color:#3daee9;">'a'</span>, <span style="color:#3daee9;">'b'</span>, <span style="color:#3daee9;">'c'</span>, <span style="color:#3daee9;">'d'</span>, <span style="color:#3daee9;">'e'</span>, <span style="color:#3daee9;">'X'</span>, <span style="color:#3daee9;">'Y'</span>, <span style="color:#3daee9;">'Z'</span>,
         <span style="color:#3daee9;">'𠀋'</span>, <span style="color:#3daee9;">'𠀌'</span>, <span style="color:#3daee9;">'𠀍'</span>, <span style="color:#3daee9;">'🂠'</span>, <span style="color:#3daee9;">'🂡'</span>, <span style="color:#3daee9;">'🂢'</span>, <span style="color:#3daee9;">'🂣'</span>, <span style="color:#3daee9;">'🂮'</span>]

<span style="color:#27ae60;">@test</span> docstrings_equal(<span style="color:#27ae60;">@doc</span>(ModuleMacroDoc), <span style="color:#f44f4f;">doc&quot;I am a module&quot;</span>)
match(<span style="color:#f44f4f;">r&quot;^</span><span style="color:#3daee9;">\s*</span><span style="color:#3daee9;">(?</span><span style="color:#f44f4f;">:#</span><span style="color:#3daee9;">|</span><span style="color:#f44f4f;">$</span><span style="color:#3daee9;">)</span><span style="color:#f44f4f;">&quot;</span>, <span style="color:#f44f4f;">&quot;# a comment&quot;</span>)
</pre></body></html>
